﻿namespace HRM.CORE
{
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using APP.HELPER;
    using Common.Class;
    using APP.HELPER.Utils.Language;
    using Security.Security;
    using Dictionary.ERP;
    using HRM.CORE;
    using HRM.CORE.Workdesk;

    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms; using Common;
    using Common;
    using DevExpress.XtraGrid.Views.Base;

    public class xfmWorkdesk : XtraForm
    {
        private IContainer components = null;
        private GridView gbList;
        private GridControl gcList;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GroupControl groupControl1;
        private GroupControl grSyslog;
        private PanelControl panelControl1;
        private PanelControl panelControl2;
        private PanelControl pnSyslog;
        private HRM.CORE.Workdesk.xucBottomDesk xucBottomDesk;
        private xucChart xucChart1;
        private xucCompany xucCompany1;
        private HRM.CORE.Workdesk.xucUser xucUser1;

        public xfmWorkdesk()
        {
            this.InitializeComponent();
            this.InitMultiLanguages();
            this.Init();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Init()
        {
            this.xucCompany1.LoadData();
            this.xucChart1.LoadData();
            this.xucUser1.LoadData();
            this.gcList.DataSource = new HRM_EMPLOYEE().GetListStatistical();
            this.xucBottomDesk = new HRM.CORE.Workdesk.xucBottomDesk();
            this.xucBottomDesk.Dock = DockStyle.Fill;
            this.pnSyslog.Controls.Add(this.xucBottomDesk);
        }

        private void InitializeComponent()
        {
            MenuButton button = new MenuButton();
            ItemCommand command = new ItemCommand();
            ItemCommand command2 = new ItemCommand();
            ItemCommand command3 = new ItemCommand();
            ItemCommand command4 = new ItemCommand();
            ItemCommand command5 = new ItemCommand();
            ItemCommand command6 = new ItemCommand();
            ItemCommand command7 = new ItemCommand();
            ItemCommand command8 = new ItemCommand();
            ItemCommand command9 = new ItemCommand();
            ItemCommand command10 = new ItemCommand();
            ItemCommand command11 = new ItemCommand();
            ItemCommand command12 = new ItemCommand();
            ItemCommand command13 = new ItemCommand();
            ItemCommand command14 = new ItemCommand();
            ItemCommand command15 = new ItemCommand();
            ItemCommand command16 = new ItemCommand();
            ItemCommand command17 = new ItemCommand();
            ItemCommand command18 = new ItemCommand();
            ItemCommand command19 = new ItemCommand();
            ItemCommand command20 = new ItemCommand();
            ItemCommand command21 = new ItemCommand();
            ItemCommand command22 = new ItemCommand();
            ItemCommand command23 = new ItemCommand();
            ItemCommand command24 = new ItemCommand();
            ItemCommand command25 = new ItemCommand();
            ItemCommand command26 = new ItemCommand();
            ItemCommand command27 = new ItemCommand();
            ItemCommand command28 = new ItemCommand();
            ItemCommand command29 = new ItemCommand();
            MenuButton button2 = new MenuButton();
            ItemCommand command30 = new ItemCommand();
            ItemCommand command31 = new ItemCommand();
            ItemCommand command32 = new ItemCommand();
            ItemCommand command33 = new ItemCommand();
            ItemCommand command34 = new ItemCommand();
            ItemCommand command35 = new ItemCommand();
            ItemCommand command36 = new ItemCommand();
            ItemCommand command37 = new ItemCommand();
            ItemCommand command38 = new ItemCommand();
            ItemCommand command39 = new ItemCommand();
            ItemCommand command40 = new ItemCommand();
            ItemCommand command41 = new ItemCommand();
            ItemCommand command42 = new ItemCommand();
            ItemCommand command43 = new ItemCommand();
            ItemCommand command44 = new ItemCommand();
            ItemCommand command45 = new ItemCommand();
            ItemCommand command46 = new ItemCommand();
            ItemCommand command47 = new ItemCommand();
            ItemCommand command48 = new ItemCommand();
            ItemCommand command49 = new ItemCommand();
            ItemCommand command50 = new ItemCommand();
            ItemCommand command51 = new ItemCommand();
            ItemCommand command52 = new ItemCommand();
            ItemCommand command53 = new ItemCommand();
            ItemCommand command54 = new ItemCommand();
            ItemCommand command55 = new ItemCommand();
            ItemCommand command56 = new ItemCommand();
            ItemCommand command57 = new ItemCommand();
            ItemCommand command58 = new ItemCommand();
            this.panelControl1 = new PanelControl();
            this.groupControl1 = new GroupControl();
            this.gcList = new GridControl();
            this.gbList = new GridView();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.xucChart1 = new xucChart();
            this.xucCompany1 = new xucCompany();
            this.panelControl2 = new PanelControl();
            this.pnSyslog = new PanelControl();
            this.grSyslog = new GroupControl();
            this.xucUser1 = new HRM.CORE.Workdesk.xucUser();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.gcList.BeginInit();
            this.gbList.BeginInit();
            this.panelControl2.BeginInit();
            this.panelControl2.SuspendLayout();
            this.pnSyslog.BeginInit();
            this.grSyslog.BeginInit();
            base.SuspendLayout();
            this.panelControl1.BorderStyle = BorderStyles.NoBorder;
            this.panelControl1.Controls.Add(this.groupControl1);
            this.panelControl1.Controls.Add(this.xucChart1);
            this.panelControl1.Controls.Add(this.xucCompany1);
            this.panelControl1.Dock = DockStyle.Left;
            this.panelControl1.Location = new Point(0, 0);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Size = new Size(370, 620);
            this.panelControl1.TabIndex = 2;
            this.groupControl1.BorderStyle = BorderStyles.NoBorder;
            this.groupControl1.Controls.Add(this.gcList);
            this.groupControl1.Dock = DockStyle.Fill;
            this.groupControl1.Location = new Point(0, 0x192);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Padding = new Padding(0, 0, 2, 0);
            this.groupControl1.Size = new Size(370, 0xda);
            this.groupControl1.TabIndex = 3;
            this.groupControl1.Text = "Thống K\x00ea Số Liệu";
            this.gcList.Dock = DockStyle.Fill;
            this.gcList.Location = new Point(0, 0);
            this.gcList.MainView = this.gbList;
            this.gcList.Name = "gcList";
            this.gcList.Size = new Size(0x170, 0xda);
            this.gcList.TabIndex = 2;
            this.gcList.ViewCollection.AddRange(new BaseView[] { this.gbList });
            this.gbList.Columns.AddRange(new GridColumn[] { this.gridColumn1, this.gridColumn2 });
            this.gbList.GridControl = this.gcList;
            this.gbList.Name = "gbList";
            this.gbList.OptionsView.EnableAppearanceEvenRow = true;
            this.gbList.OptionsView.ShowGroupPanel = false;
            this.gbList.OptionsView.ShowIndicator = false;
            this.gbList.OptionsView.ShowViewCaption = true;
            this.gbList.ViewCaption = "Thống K\x00ea Số Liệu";
            this.gridColumn1.FieldName = "Name";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.OptionsColumn.ReadOnly = true;
            this.gridColumn1.OptionsColumn.ShowCaption = false;
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn1.Width = 0x9d;
            this.gridColumn2.AppearanceCell.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.gridColumn2.AppearanceCell.Options.UseFont = true;
            this.gridColumn2.FieldName = "Value";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.OptionsColumn.ReadOnly = true;
            this.gridColumn2.OptionsColumn.ShowCaption = false;
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.gridColumn2.Width = 0x58;
            this.xucChart1.Dock = DockStyle.Top;
            this.xucChart1.IsClose = CloseOrNew.None;
            this.xucChart1.Location = new Point(0, 170);
            this.xucChart1.Name = "xucChart1";
            this.xucChart1.NotSave = false;
            this.xucChart1.Padding = new Padding(0, 0, 2, 2);
            command.Caption = "";
            command.Enable = false;
            command.Visibility = BarItemVisibility.Never;
            button.Add = command;
            command2.Caption = "";
            command2.Enable = false;
            command2.Visibility = BarItemVisibility.Never;
            button.Cancel = command2;
            command3.Caption = "";
            command3.Enable = false;
            command3.Visibility = BarItemVisibility.Never;
            button.Change = command3;
            command4.Caption = "";
            command4.Enable = false;
            command4.Visibility = BarItemVisibility.Never;
            button.Close = command4;
            command5.Caption = "";
            command5.Enable = false;
            command5.Visibility = BarItemVisibility.Never;
            button.Custom = command5;
            command6.Caption = "";
            command6.Enable = false;
            command6.Visibility = BarItemVisibility.Never;
            button.Delete = command6;
            command7.Caption = "";
            command7.Enable = false;
            command7.Visibility = BarItemVisibility.Never;
            button.Export = command7;
            command8.Caption = "";
            command8.Enable = false;
            command8.Visibility = BarItemVisibility.Never;
            button.Filter = command8;
            command9.Caption = "";
            command9.Enable = false;
            command9.Visibility = BarItemVisibility.Never;
            button.FilterCustomer = command9;
            command10.Caption = "";
            command10.Enable = false;
            command10.Visibility = BarItemVisibility.Never;
            button.FilterStock = command10;
            command11.Caption = "";
            command11.Enable = false;
            command11.Visibility = BarItemVisibility.Never;
            button.Find = command11;
            button.GClose = false;
            button.GCommand = false;
            button.GExport = false;
            command12.Caption = "";
            command12.Enable = false;
            command12.Visibility = BarItemVisibility.Never;
            button.Go = command12;
            button.GOption = false;
            button.GPrint = false;
            button.GRecords = false;
            button.GSearchBar = false;
            button.GSettings = false;
            button.GVaildation = false;
            command13.Caption = "";
            command13.Enable = false;
            command13.Visibility = BarItemVisibility.Never;
            button.Import = command13;
            command14.Caption = "";
            command14.Enable = false;
            command14.Visibility = BarItemVisibility.Never;
            button.Next = command14;
            command15.Caption = "";
            command15.Enable = false;
            command15.Visibility = BarItemVisibility.Never;
            button.PageSetup = command15;
            button.PHome = false;
            command16.Caption = "";
            command16.Enable = false;
            command16.Visibility = BarItemVisibility.Never;
            button.Previous = command16;
            command17.Caption = "";
            command17.Enable = false;
            command17.Visibility = BarItemVisibility.Never;
            button.Print = command17;
            command18.Caption = "";
            command18.Enable = false;
            command18.Visibility = BarItemVisibility.Never;
            button.PrintPreview = command18;
            button.PTool = false;
            command19.Caption = "";
            command19.Enable = false;
            command19.Visibility = BarItemVisibility.Never;
            button.Redo = command19;
            command20.Caption = "";
            command20.Enable = false;
            command20.Visibility = BarItemVisibility.Never;
            button.Refresh = command20;
            command21.Caption = "";
            command21.Enable = false;
            command21.Visibility = BarItemVisibility.Never;
            button.Save = command21;
            command22.Caption = "";
            command22.Enable = false;
            command22.Visibility = BarItemVisibility.Never;
            button.SaveAndClose = command22;
            command23.Caption = "";
            command23.Enable = false;
            command23.Visibility = BarItemVisibility.Never;
            button.SaveAndNew = command23;
            command24.Caption = "";
            command24.Enable = false;
            command24.Visibility = BarItemVisibility.Never;
            button.Search = command24;
            command25.Caption = "";
            command25.Enable = false;
            command25.Visibility = BarItemVisibility.Never;
            button.SearchText = command25;
            command26.Caption = "";
            command26.Enable = false;
            command26.Visibility = BarItemVisibility.Never;
            button.Task = command26;
            command27.Caption = "";
            command27.Enable = false;
            command27.Visibility = BarItemVisibility.Never;
            button.Undo = command27;
            command28.Caption = "";
            command28.Enable = false;
            command28.Visibility = BarItemVisibility.Never;
            button.Vaildate = command28;
            command29.Caption = "";
            command29.Enable = false;
            command29.Visibility = BarItemVisibility.Never;
            button.View = command29;
            this.xucChart1.RibbonBar = button;
            this.xucChart1.Size = new Size(370, 0xe8);
            this.xucChart1.Status = Actions.None;
            this.xucChart1.TabIndex = 1;
            this.xucChart1.Title = "";
            this.xucCompany1.Dock = DockStyle.Top;
            this.xucCompany1.Location = new Point(0, 0);
            this.xucCompany1.Name = "xucCompany1";
            this.xucCompany1.Padding = new Padding(0, 0, 2, 2);
            this.xucCompany1.Size = new Size(370, 170);
            this.xucCompany1.TabIndex = 0;
            this.panelControl2.BorderStyle = BorderStyles.NoBorder;
            this.panelControl2.Controls.Add(this.pnSyslog);
            this.panelControl2.Controls.Add(this.grSyslog);
            this.panelControl2.Controls.Add(this.xucUser1);
            this.panelControl2.Dock = DockStyle.Fill;
            this.panelControl2.Location = new Point(370, 0);
            this.panelControl2.Name = "panelControl2";
            this.panelControl2.Size = new Size(0x2be, 620);
            this.panelControl2.TabIndex = 3;
            this.pnSyslog.BorderStyle = BorderStyles.NoBorder;
            this.pnSyslog.Dock = DockStyle.Fill;
            this.pnSyslog.Location = new Point(0, 0xc0);
            this.pnSyslog.Name = "pnSyslog";
            this.pnSyslog.Size = new Size(0x2be, 0x1ac);
            this.pnSyslog.TabIndex = 2;
            this.grSyslog.Dock = DockStyle.Top;
            this.grSyslog.Location = new Point(0, 170);
            this.grSyslog.Name = "grSyslog";
            this.grSyslog.Size = new Size(0x2be, 0x16);
            this.grSyslog.TabIndex = 1;
            this.grSyslog.Text = "Nhật K\x00fd Hệ Thống";
            this.grSyslog.Visible = false;
            this.xucUser1.Dock = DockStyle.Top;
            this.xucUser1.IsClose = CloseOrNew.None;
            this.xucUser1.Location = new Point(0, 0);
            this.xucUser1.Name = "xucUser1";
            this.xucUser1.NotSave = false;
            this.xucUser1.Padding = new Padding(0, 0, 0, 2);
            command30.Caption = "";
            command30.Enable = false;
            command30.Visibility = BarItemVisibility.Never;
            button2.Add = command30;
            command31.Caption = "";
            command31.Enable = false;
            command31.Visibility = BarItemVisibility.Never;
            button2.Cancel = command31;
            command32.Caption = "";
            command32.Enable = false;
            command32.Visibility = BarItemVisibility.Never;
            button2.Change = command32;
            command33.Caption = "";
            command33.Enable = false;
            command33.Visibility = BarItemVisibility.Never;
            button2.Close = command33;
            command34.Caption = "";
            command34.Enable = false;
            command34.Visibility = BarItemVisibility.Never;
            button2.Custom = command34;
            command35.Caption = "";
            command35.Enable = false;
            command35.Visibility = BarItemVisibility.Never;
            button2.Delete = command35;
            command36.Caption = "";
            command36.Enable = false;
            command36.Visibility = BarItemVisibility.Never;
            button2.Export = command36;
            command37.Caption = "";
            command37.Enable = false;
            command37.Visibility = BarItemVisibility.Never;
            button2.Filter = command37;
            command38.Caption = "";
            command38.Enable = false;
            command38.Visibility = BarItemVisibility.Never;
            button2.FilterCustomer = command38;
            command39.Caption = "";
            command39.Enable = false;
            command39.Visibility = BarItemVisibility.Never;
            button2.FilterStock = command39;
            command40.Caption = "";
            command40.Enable = false;
            command40.Visibility = BarItemVisibility.Never;
            button2.Find = command40;
            button2.GClose = false;
            button2.GCommand = false;
            button2.GExport = false;
            command41.Caption = "";
            command41.Enable = false;
            command41.Visibility = BarItemVisibility.Never;
            button2.Go = command41;
            button2.GOption = false;
            button2.GPrint = false;
            button2.GRecords = false;
            button2.GSearchBar = false;
            button2.GSettings = false;
            button2.GVaildation = false;
            command42.Caption = "";
            command42.Enable = false;
            command42.Visibility = BarItemVisibility.Never;
            button2.Import = command42;
            command43.Caption = "";
            command43.Enable = false;
            command43.Visibility = BarItemVisibility.Never;
            button2.Next = command43;
            command44.Caption = "";
            command44.Enable = false;
            command44.Visibility = BarItemVisibility.Never;
            button2.PageSetup = command44;
            button2.PHome = false;
            command45.Caption = "";
            command45.Enable = false;
            command45.Visibility = BarItemVisibility.Never;
            button2.Previous = command45;
            command46.Caption = "";
            command46.Enable = false;
            command46.Visibility = BarItemVisibility.Never;
            button2.Print = command46;
            command47.Caption = "";
            command47.Enable = false;
            command47.Visibility = BarItemVisibility.Never;
            button2.PrintPreview = command47;
            button2.PTool = false;
            command48.Caption = "";
            command48.Enable = false;
            command48.Visibility = BarItemVisibility.Never;
            button2.Redo = command48;
            command49.Caption = "";
            command49.Enable = false;
            command49.Visibility = BarItemVisibility.Never;
            button2.Refresh = command49;
            command50.Caption = "";
            command50.Enable = false;
            command50.Visibility = BarItemVisibility.Never;
            button2.Save = command50;
            command51.Caption = "";
            command51.Enable = false;
            command51.Visibility = BarItemVisibility.Never;
            button2.SaveAndClose = command51;
            command52.Caption = "";
            command52.Enable = false;
            command52.Visibility = BarItemVisibility.Never;
            button2.SaveAndNew = command52;
            command53.Caption = "";
            command53.Enable = false;
            command53.Visibility = BarItemVisibility.Never;
            button2.Search = command53;
            command54.Caption = "";
            command54.Enable = false;
            command54.Visibility = BarItemVisibility.Never;
            button2.SearchText = command54;
            command55.Caption = "";
            command55.Enable = false;
            command55.Visibility = BarItemVisibility.Never;
            button2.Task = command55;
            command56.Caption = "";
            command56.Enable = false;
            command56.Visibility = BarItemVisibility.Never;
            button2.Undo = command56;
            command57.Caption = "";
            command57.Enable = false;
            command57.Visibility = BarItemVisibility.Never;
            button2.Vaildate = command57;
            command58.Caption = "";
            command58.Enable = false;
            command58.Visibility = BarItemVisibility.Never;
            button2.View = command58;
            this.xucUser1.RibbonBar = button2;
            this.xucUser1.Size = new Size(0x2be, 170);
            this.xucUser1.Status = Actions.None;
            this.xucUser1.TabIndex = 0;
            this.xucUser1.Title = "";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            //base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x430, 620);
            base.Controls.Add(this.panelControl2);
            base.Controls.Add(this.panelControl1);
            base.Name = "xfmWorkdesk";
            this.Text = "B\x00e0n L\x00e0m Việc";
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.gcList.EndInit();
            this.gbList.EndInit();
            this.panelControl2.EndInit();
            this.panelControl2.ResumeLayout(false);
            this.pnSyslog.EndInit();
            this.grSyslog.EndInit();
            base.ResumeLayout(false);
        }

        private void InitMultiLanguages()
        {
            this.Text = MultiLanguages.GetString("tbl_DashBoard", "DashBoard", "B\x00e0n L\x00e0m Việc");
            this.grSyslog.Text = MultiLanguages.GetString("tbl_DashBoard", "SystemLog", "Nhật K\x00fd Hệ Thống");
            this.gbList.ViewCaption = MultiLanguages.GetString("tbl_DashBoard", "Statistic", "Thống K\x00ea Số Liệu");
        }

        public void LoadBottomDesk()
        {
            if (this.xucBottomDesk != null)
            {
                this.xucBottomDesk.LoadChartSalary();
            }
        }

        public void LoadCompanyData()
        {
            this.xucCompany1.LoadData();
        }
    }
}